package org.example.service;

import org.example.utils.SpringContextUtils;
import org.example.vo.CurriculumPlanVo;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContext;

/**
 * @author Rongchang Wu
 */
public class AddData {
    public static void main(String[] args) {
//        ApplicationContext ac = new ClassPathXmlApplicationContext("config/applicationContext.xml");
        TestService t = (TestService) SpringContextUtils.getBean("testServiceImpl");
        System.out.println(t);
        for (int i = 0; i < 100; i++) {
            CurriculumPlanVo c = new CurriculumPlanVo();
            c.setCurriculumName("概率论与数理统计" + (i + 2));
            c.setCurriculumPlanName("软件工程系软件工程专业课程计划" + (i + 2));
            c.setDepartment("软件工程" + (i + 2));
            c.setMajor("软件工程" + (i + 2));
            c.setSemester("2021-2022-" + (i + 2));
            t.addCurriculumPlan(c);
        }
    }
}
